 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="avicit.platform6.commons.utils.ViewUtil"%>
<%@page import="avicit.platform6.core.locale.PlatformLocalesJSTL"%>
<%@page import="java.util.Locale"%>
<%@page import="avicit.platform6.api.session.SessionHelper"%>
<%@page import="avicit.platform6.api.sysshirolog.impl.AfterLoginSessionProcess"%>
<% 
Object lang=session.getAttribute(AfterLoginSessionProcess.SESSION_CURRENT_LANGUAGE_CODE);
String languageCode="zh_CN";
if(lang!=null){
	languageCode=lang.toString();
}
	Locale locale =SessionHelper.getLocaleByUser(request);
%>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%--报表配置 --%>
<title><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.button.reportConfiguration","i18n.lantop",locale)%></title>
<base href="<%=ViewUtil.getRequestPath(request)%>">
<jsp:include
	page="/avicit/platform6/component/common/EasyUIJsInclude.jsp"></jsp:include>
<jsp:include page="/avicit/im/common/ImUIJSCSSInclude.jsp"></jsp:include>
<link href="static/css/custom/lantop/css/custom.css" type="text/css"  rel="stylesheet">
<script type="text/javascript" src="avicit/im/lantop/basic/reportmanager/js/PrintReportConfig.js"></script>

<script type="text/javascript"
	src="avicit/im/lantop/basic/reportmanager/locale/language_<%=languageCode%>.js"></script>
</head>
<script type="text/javascript">
	var baseurl = "<%=ViewUtil.getRequestPath(request)%>";
	var dialogId = '${dialogId}'; 			// 对话框ID
	var templateId = "${templateId}";		// 模板ID
	var type = "${type}";					// 1 从配置按钮取消按钮到这里， 2 选择页面配置报表
	var resultDataSource = "${resultDataSource}";	// 配置表名集合
	var sysId = "${sysId}";				// 标识符
	var tableNameIds = '${tableNameIds}';	// 与之关联的表的集合,最多只有两个用, 分隔
	var colNamesDataGrid ;
	var columnsDataGrid ;
	var outputFields = [];
	var fieldsCount;
	var sql ;
	
	var nodesFieldIndex = {};
	
	$(function(){
		colNamesDataGrid = $("#colNamesDataGrid");
		columnsDataGrid = $("#columnsDataGrid");
		
		
		fields = '${outPutFields}';
		fieldCount = Number('${fieldsCount}');
		// 通过AJAX请求获取表中的字段
		$.ajax({
			url : 'platform/ReportFormConfigController/getTableListByTableIds',
			dataType : 'json',
			data : {
				sysId : sysId,
				tableIds : tableNameIds,
				templateId : templateId
			},
			success : function(result){
				// 获取数据成功后，加载到datagrid中
				$("#columnsDataGrid").datagrid('loadData', result.rows);
				$("#colNamesDataGrid").datagrid("loadData", result.setFields);
				getCurrColumnForCurrOutput();
			}
			
		});
		
	});
	
	
	function formatterField(value,row,index){
		var colName = row.COL_NAME;
		if(colName == undefined || colName == null || colName == "" ){
			return value;
		}
		return  row.TABLE_TITLE + "." + value;
	}
	
	
</script>
<style>

	.btn_go{
		display:inline-block;
		width:30px;
		margin:12px;

		/* border:1px solid #dedede; 
		border-radius:3px;*/

	}
	.btn_go  img{
	  width:30px;
	  height:24px;
	  vertical-align: middle;
	}
	/* .btn_go:hover{
		border-color: deepskyblue;
	} */
	.datagrid-view2{
	   /* border-left:1px solid #dedede; */
	    border-right:1px solid #dedede; 
	 }
	.datagrid-body td{
	   background:none !important;
	}
	.easyui-validatebox{
	  width:100%;
	  
	}
</style>
<body class="easyui-layout">

	<div data-options="region:'north',split:false,border:false" style="height:100px;overflow-x: auto; ">
	
		<div style="padding-left:10px;margin: 4px;height:65px;">
			<table align="center" class="form_commonTable">
				<tr>
					<%--报表应输出字段： --%>
					<th width="20%"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.printreportconfig.reportshouldoutputfields","i18n.lantop",locale)%></th>
					<td>
						<input id="output" class="easyui-validatebox" value="${outPutFields} " readonly="true" />  
					</td>
				</tr>
				<tr>
					<%--实际应输出字段： --%>
					<th width="20%"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.printreportconfig.reportinfactoutputfields","i18n.lantop",locale)%></th>
					<td>
						<input id="currOutput" class="easyui-validatebox" data-options="required:true" readonly="true"/>
					</td>
				
				</tr>
			</table>
		</div>
	</div>  
    
     
    <div data-options="region:'center',border:false" overflow-y: auto;">
    	
	    <div id="cc" class="easyui-layout" fit="true">
	     
		    <div data-options="region:'east',iconCls:'icon-reload',noheader:true,split:false" style="width:400px;border:1px  solid #dedede;">
				<table id="colNamesDataGrid" class="easyui-datagrid"
					data-options="
							fit:true,
							animate: true,
							collapsible: false,
							fitColumns: true,
							scrollbarSize:0,
							autoRowHeight: false,
							singleSelect: true,
							striped:true,
							rownumbers: false,
							method: 'post',
							rowStyler: rowColor,
							remoteSort : false
						">
					<thead>
						<tr>
							 <sec:accesscontrollist hasPermission="3" domainObject="excel_export_datagrid_id">														<%--表名--%>
										<th data-options="field:'TABLE_NAME',  hidden:true ,  halign:'center', align:'center', sortable:false," width="200" title="表名"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.reportformconfig.tablename","i18n.lantop",locale)%></th>
							 </sec:accesscontrollist>
							 
							 <sec:accesscontrollist hasPermission="3" domainObject="excel_export_datagrid_id">														<%--表名--%>
										<th data-options="field:'TABLE_TITLE',  hidden:true ,  halign:'center', align:'center', sortable:false," width="200" title="表名"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.reportformconfig.tablename","i18n.lantop",locale)%></th>
							 </sec:accesscontrollist>
									 
							<sec:accesscontrollist hasPermission="3" domainObject="excel_export_datagrid_id">														<%--字段名称--%>
										<th data-options="field:'COL_NAME',  hidden:true , halign:'center', align:'center', sortable:false," width="200" title="字段名称"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.reportformconfig.filedname","i18n.lantop",locale)%></th>
							</sec:accesscontrollist>
									
							<sec:accesscontrollist hasPermission="3" domainObject="excel_export_choose_datagrid_colName">											<%--字段名称--%>
								<th data-options="field:'COL_LABEL', halign:'center', align:'center', sortable:false,formatter:formatterField"width="200" title="字段名称"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.reportformconfig.filedname","i18n.lantop",locale)%></th>
							</sec:accesscontrollist>
						</tr>
					</thead>
				</table>

			</div>   
 <div data-options="region:'center',border:false" style="width:80px;overflow: hidden;">
    	<div style="margin-left: 36%;padding-top: 32%;width:100px;">
    		
							<%-- 选值右移 --%>
							<div class="btn_go" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.cbb.techclass.execlexp.rightMove","i18n.lantop",locale)%>" onclick="oneAdd();"><img src="avicit/im/lantop/common/search/image/goright.png"></div>
							<%-- <input type="button" style="width:80px;text-align:'center';" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.common.dataCheckRepeat.rightMove","i18n.lantop",locale)%>" onclick="oneAdd();" value="【 >】" href="javascript:void(0);"></input> --%>
		
							<%-- 全右移 --%>
								<div class="btn_go" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.cbb.techclass.execlexp.allRightMove","i18n.lantop",locale)%>" onclick="allAdd();" ><img src="avicit/im/lantop/common/search/image/gorights.png"></div>
							<%-- <input type="button" style="width:80px;text-align:'center';" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.common.dataCheckRepeat.allRightMove","i18n.lantop",locale)%>" onclick="allAdd();" value="【>>】" href="javascript:void(0);"></input> --%>
					
							<%-- 选值左移 --%>
							<div class="btn_go" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.cbb.techclass.execlexp.leftMove","i18n.lantop",locale)%>" onclick="oneRemove();" style="margin-top:25px;"><img src="avicit/im/lantop/common/search/image/goleft.png"></div>
							<%-- <input type="button" style="width:80px;text-align:'center';" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.common.dataCheckRepeat.leftMove","i18n.lantop",locale)%>"  onclick="oneRemove();" value="【 <】" href="javascript:void(0);"></input> --%>
					
							<%-- 全左移 --%>
							<div class="btn_go"  title="<%=PlatformLocalesJSTL.getBundleValue("lantop.cbb.techclass.execlexp.allLeftMove","i18n.lantop",locale)%>" onclick="allRemove();"><img src="avicit/im/lantop/common/search/image/golefts.png"></div>
							<%-- <input type="button" style="width:80px;text-align:'center';" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.common.dataCheckRepeat.allLeftMove","i18n.lantop",locale)%>" onclick="allRemove();" value="【<<】" href="javascript:void(0);"></input> --%>
			
    	</div>
    </div>
			<div data-options="region:'west',noheader:true,split:false" style="width:400px;border:1px  solid #dedede;">
				<table id="columnsDataGrid" class="easyui-datagrid"
							data-options="
								fit:true,
								animate: true,
								collapsible: false,
								fitColumns: true,
								scrollbarSize:0,
								autoRowHeight: false,
								singleSelect: true,
								striped:true,
								method: 'post',
								rownumbers: false,
								onDblClickRow: oneAdd,
								rowStyler: rowColor,
								remoteSort : true,
							">
							<thead>
								<tr>
									 <sec:accesscontrollist hasPermission="3" domainObject="excel_export_datagrid_id">													<%--表名--%>
										<th data-options="field:'TABLE_NAME',  hidden:true ,  halign:'center', align:'center', sortable:false," width="200" title="表名"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.reportformconfig.tablename","i18n.lantop",locale)%></th>
									</sec:accesscontrollist>
									 
									 <sec:accesscontrollist hasPermission="3" domainObject="excel_export_datagrid_id">													<%--字段名称--%>
										<th data-options="field:'TABLE_TITLE',  hidden:true , halign:'center', align:'center', sortable:false," width="200" title="字段名称"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.reportformconfig.filedname","i18n.lantop",locale)%></th>
									</sec:accesscontrollist>
									
									 <sec:accesscontrollist hasPermission="3" domainObject="excel_export_datagrid_id">													<%--字段名称--%>
										<th data-options="field:'COL_NAME',  hidden:true , halign:'center', align:'center', sortable:false," width="200" title="字段名称"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.reportformconfig.filedname","i18n.lantop",locale)%></th>
									</sec:accesscontrollist>
									
									 
									
									<sec:accesscontrollist hasPermission="3" domainObject="excel_export_column_datagrid_colName">													<%--字段名称--%>
										<th data-options="title:'', field:'COL_LABEL', halign:'center', align:'center', sortable:false,formatter:formatterField" width="200" title="字段名称"><%=PlatformLocalesJSTL.getBundleValue("lantop.basicdatamanager.reportmanager.reportformconfig.filedname","i18n.lantop",locale)%></th>
									</sec:accesscontrollist>
								</tr>
							</thead>
						</table>
			
			</div>   
		
		</div>  

    	
    </div>
    
  
    <div data-options="region:'south',split:false,border:true,align:'center',fit:false" style="height:60px;overflow-y: hidden;">
    	
    		<table align="center"  style="margin-top:18px;">
    			<tr>
    				<td>
    					<sec:accesscontrollist  hasPermission="3" domainObject="excel_export_button_exportData" >
							<%--保存--%>
							<a id="saveBtn" title="<%=PlatformLocalesJSTL.getBundleValue("lantop.save","i18n.lantop",locale)%>" data-options="disabled:false" class="easyui-linkbutton  selbtnc"  iconCls="icon-im-save" onclick="save();" href="javascript:void(0);"><%=PlatformLocalesJSTL.getBundleValue("lantop.save","i18n.lantop",locale)%></a>
						</sec:accesscontrollist>
						<sec:accesscontrollist  hasPermission="3" domainObject="excel_export_button_cancle" >
							<%--关闭--%>
							<a class="easyui-linkbutton  selbtn"  style="margin-left:20px;"  onclick="cancel();" href="javascript: void(0);">
			    			<img  src="avicit/im/lantop/documents/Filecollection/img/close.png">
			    			<span class="selbtc">取消</span>
			    			</a>
							<!-- <a id="cancleBtn" title="取消"  class="easyui-linkbutton"  iconCls="icon-im-close-all"  onclick="cancle();" href="javascript:void(0);">取消</a> -->
						</sec:accesscontrollist>
    				</td>
    				
    			</tr>
    		</table>
		
    </div>
    
    	<script type="text/javascript" src="static/js/platform/index/js/divscroll.js"></script>
<script>
function cancel(){
	 parent.$("#" + dialogId).dialog('close');
}
$(function(){
	$(".datagrid-view2>.datagrid-body").perfectScrollbar();
});
</script>
</body>
</html>